package com.example.custom.tag;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

	@SuppressWarnings({ "resource", "unchecked" })
	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
		SimpleDateFormat format = (SimpleDateFormat) context.getBean("defaultDateFormat");
		System.out.println(format.format(new Date()));

		List<File> fileList = (List<File>) context.getBean("xmlList");
		for (File file : fileList) {
			System.out.println(file.getName());
		}

		Component component = (Component) context.getBean("bionic-family");
		System.out.println(component.getName());
		List<Component> components = component.getComponents();
		components.stream().forEach(com -> {
			System.out.println(com.getName());
		});
	}
}
